package com.by.config;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.06.07.14.57
 */
@RestController
@RequestMapping("/stock")
public class StockController {
    @GetMapping("/update")
    public String update(){
        System.out.println("-----库存更新--");
     return "库存更新";
    }
    @GetMapping("/query")
    public Map query() throws InterruptedException {
       // Thread.sleep(2000);
        Map map=new HashMap();
        map.put("name","华为手机");
        map.put("stock",100);
        return map;
    }
}
